from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response

from projectmanager import ProjectManager

proj_manager = ProjectManager("projects")

def home(request):
	if request.user.is_authenticated():
		return render_to_response("home.html",{'username':request.user.get_username()})
	else:
		return HttpResponseRedirect("/login")
	
	
def create_project(request):
	proj_manager.create_project('test')

def list_projects(request):
	return HttpResponse(proj_manager.list_projects())
